<?php
	include 'init.php';
	if ($listid)
	{
		$receiverid = $_POST[receiverid];
		$fullname	= $_POST[fullname];
		$shortname	= $_POST[shortname];
		$cellphone	= $_POST[cellphone];
		$phone		= $_POST[phone];
		$email		= $_POST[email];
		$birthday	= $_POST[birthday];

		$con = mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
		mysql_select_db("$DBName", $con);

		$sql="UPDATE $TReceivers SET
			ListId = '$listid', FullName = '$fullname', ShortName = '$shortname', CellPhone = '$cellphone', Phone = '$phone', Email = '$email', BirthDay = '$birthday'
			WHERE ReceiverId = '$receiverid'";

		if (!mysql_query($sql,$con))
		{
			die('Error: ' . mysql_error());
		}

		mysql_close($con);

		$to = "/receivers/$listid/$fromphone";
		header('Location: '. $to);
	}
?>